def thesum(n):
    total=0
    f=1
    i=1
    while((1/i)>n):
        total += f/i
        f=-f
        i+=2
    return total
n=eval(input())
total=thesum(n)
plustotal=total*4
print(total)
print(plustotal)